<?php
//+-----------------------------------------------------------
//| 人生是荒芜的旅行，冷暖自知，苦乐在心
//+-----------------------------------------------------------
//| Author:Janmas <janmas@126.com>
//+-----------------------------------------------------------
//| 
//+-----------------------------------------------------------


namespace app\admin\validate;

class MenuValidate extends AdminValidate
{
    protected $rule = [
        'name' => 'require|max:15',
        'controller' => 'require|max:15|alphaDash|checkController',
        'icon' => 'max:15',
        'pid' => 'require|integer',
        'action' => 'checkAction',
    ];

    protected $message = [
        'name.require' => '请输入菜单名称',
        'name.max' => '菜单名不能超过15个字符',
        'controller.require' => '请输入控制器名',
        'controller.max' => '控制器名不得超过15个字符',
        'controler.alphaDash' => '控制器名只能是数字、字母、_、-',
        'pid.require' => '请选择一个上级',
        'pid.integer' => '系统异常（pid类型错误）',
    ];

    protected $scene = [
        'create' => ['name','pid','controller','icon','action'],
    ];


}